<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@include file="../WEB-INF/jspf/controlesessao.jspf"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Lista Competencias</title>
        <script type="text/javascript" src="../js/jquery.js" ></script>
        <script type="text/javascript" src="../js/jquery.validate.js"></script>
        <script type="text/javascript" src="../js/jquery.tablescroll.js"></script>
        <script type="text/javascript" src="../js/forms.js"></script>
        <script type="text/javascript" src="../js/jquery-ui-1.8.2.custom.min.js" ></script>
        <link rel="stylesheet" href="../css/ui-lightness/jquery-ui-1.8.2.custom.css">
    <link rel="stylesheet" href="../css/forms.css"></head>
 <script>
       
        $(function() {
            $("#nova").button();
        });

    </script>
    <body>
        <div id="formulario">
            <h1>Listar Competencias</h1>
            <form name="form" id="form" method="post" >
                <p>
                    <label class="lbInput">Descrição</label>
                    <input name="desc" value="${param.desc}">
                </p>
                <input type="image" class="noborder" src="../imagens/procurar.png" onclick="submit()">
            <input type="hidden" id="token" name="token" value="${sessionScope.token}" /> </form>
            <br>
            <a id="nova" href="fm_new_Competencias.jsp">Nova Competência</a>

            <sql:query var="query" dataSource="jdbc/dbo_MicrosoftSQLServer">
                SELECT  * FROM Competencias
                where desc_competencia like ?
                <sql:param value="${param.desc}%"/>
            </sql:query>
            <table cellspacing="0" width="400px">  <thead>
                    <th> ID </th>
                    <th>Competência</th>
                </thead>
                <tfoot>
                    <tr>
                        <td colspan="2">
                            ${query.rowCount} registros encontrados
                        </td>
                    </tr>
                </tfoot>
                <c:forEach var="row" items="${query.rows}">
                    <tr><td><a href="fm_update_Competencias.jsp?token=${sessionScope.token}&chave=${row.id_competencia}">${row.id_competencia}</a></td>
                        <td>${row.desc_competencia}</td>
                    </tr></c:forEach>
                </table>
            </div>
            <script>
                jQuery(document).ready(function($)
                {
                    $('table').tableScroll({height:300});

                });
            </script>
        </body>
    </html>
